Left Termination of the query pattern goal_in_1(g) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

append([], XS, XS).
append(.(X, XS), YS, .(X, ZS)) :- append(XS, YS, ZS).
s2l(s(X), .(Y, Xs)) :- s2l(X, Xs).
s2l(0, []).
goal(X) :- ','(s2l(X, XS), append(XS, YS, ZS)).

Queries:

goal(g).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, append_in(XS, YS, ZS))
append_in(.(X, XS), YS, .(X, ZS)) → U1(X, XS, YS, ZS, append_in(XS, YS, ZS))
append_in([], XS, XS) → append_out([], XS, XS)
U1(X, XS, YS, ZS, append_out(XS, YS, ZS)) → append_out(.(X, XS), YS, .(X, ZS))
U4(X, append_out(XS, YS, ZS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
append_in(x1, x2, x3)  =  append_in(x1)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out
goal_out(x1)  =  goal_out

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, append_in(XS, YS, ZS))
append_in(.(X, XS), YS, .(X, ZS)) → U1(X, XS, YS, ZS, append_in(XS, YS, ZS))
append_in([], XS, XS) → append_out([], XS, XS)
U1(X, XS, YS, ZS, append_out(XS, YS, ZS)) → append_out(.(X, XS), YS, .(X, ZS))
U4(X, append_out(XS, YS, ZS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
append_in(x1, x2, x3)  =  append_in(x1)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out
goal_out(x1)  =  goal_out


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

GOAL_IN(X) → U31(X, s2l_in(X, XS))
GOAL_IN(X) → S2L_IN(X, XS)
S2L_IN(s(X), .(Y, Xs)) → U21(X, Y, Xs, s2l_in(X, Xs))
S2L_IN(s(X), .(Y, Xs)) → S2L_IN(X, Xs)
U31(X, s2l_out(X, XS)) → U41(X, append_in(XS, YS, ZS))
U31(X, s2l_out(X, XS)) → APPEND_IN(XS, YS, ZS)
APPEND_IN(.(X, XS), YS, .(X, ZS)) → U11(X, XS, YS, ZS, append_in(XS, YS, ZS))
APPEND_IN(.(X, XS), YS, .(X, ZS)) → APPEND_IN(XS, YS, ZS)

The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, append_in(XS, YS, ZS))
append_in(.(X, XS), YS, .(X, ZS)) → U1(X, XS, YS, ZS, append_in(XS, YS, ZS))
append_in([], XS, XS) → append_out([], XS, XS)
U1(X, XS, YS, ZS, append_out(XS, YS, ZS)) → append_out(.(X, XS), YS, .(X, ZS))
U4(X, append_out(XS, YS, ZS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
append_in(x1, x2, x3)  =  append_in(x1)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out
goal_out(x1)  =  goal_out
S2L_IN(x1, x2)  =  S2L_IN(x1)
U41(x1, x2)  =  U41(x2)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1)
U21(x1, x2, x3, x4)  =  U21(x4)
U31(x1, x2)  =  U31(x2)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
GOAL_IN(x1)  =  GOAL_IN(x1)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

GOAL_IN(X) → U31(X, s2l_in(X, XS))
GOAL_IN(X) → S2L_IN(X, XS)
S2L_IN(s(X), .(Y, Xs)) → U21(X, Y, Xs, s2l_in(X, Xs))
S2L_IN(s(X), .(Y, Xs)) → S2L_IN(X, Xs)
U31(X, s2l_out(X, XS)) → U41(X, append_in(XS, YS, ZS))
U31(X, s2l_out(X, XS)) → APPEND_IN(XS, YS, ZS)
APPEND_IN(.(X, XS), YS, .(X, ZS)) → U11(X, XS, YS, ZS, append_in(XS, YS, ZS))
APPEND_IN(.(X, XS), YS, .(X, ZS)) → APPEND_IN(XS, YS, ZS)

The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, append_in(XS, YS, ZS))
append_in(.(X, XS), YS, .(X, ZS)) → U1(X, XS, YS, ZS, append_in(XS, YS, ZS))
append_in([], XS, XS) → append_out([], XS, XS)
U1(X, XS, YS, ZS, append_out(XS, YS, ZS)) → append_out(.(X, XS), YS, .(X, ZS))
U4(X, append_out(XS, YS, ZS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
append_in(x1, x2, x3)  =  append_in(x1)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out
goal_out(x1)  =  goal_out
S2L_IN(x1, x2)  =  S2L_IN(x1)
U41(x1, x2)  =  U41(x2)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1)
U21(x1, x2, x3, x4)  =  U21(x4)
U31(x1, x2)  =  U31(x2)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
GOAL_IN(x1)  =  GOAL_IN(x1)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 6 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN(.(X, XS), YS, .(X, ZS)) → APPEND_IN(XS, YS, ZS)

The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, append_in(XS, YS, ZS))
append_in(.(X, XS), YS, .(X, ZS)) → U1(X, XS, YS, ZS, append_in(XS, YS, ZS))
append_in([], XS, XS) → append_out([], XS, XS)
U1(X, XS, YS, ZS, append_out(XS, YS, ZS)) → append_out(.(X, XS), YS, .(X, ZS))
U4(X, append_out(XS, YS, ZS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
append_in(x1, x2, x3)  =  append_in(x1)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out
goal_out(x1)  =  goal_out
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN(.(X, XS), YS, .(X, ZS)) → APPEND_IN(XS, YS, ZS)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND_IN(.(XS)) → APPEND_IN(XS)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

S2L_IN(s(X), .(Y, Xs)) → S2L_IN(X, Xs)

The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, append_in(XS, YS, ZS))
append_in(.(X, XS), YS, .(X, ZS)) → U1(X, XS, YS, ZS, append_in(XS, YS, ZS))
append_in([], XS, XS) → append_out([], XS, XS)
U1(X, XS, YS, ZS, append_out(XS, YS, ZS)) → append_out(.(X, XS), YS, .(X, ZS))
U4(X, append_out(XS, YS, ZS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
append_in(x1, x2, x3)  =  append_in(x1)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out
goal_out(x1)  =  goal_out
S2L_IN(x1, x2)  =  S2L_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

S2L_IN(s(X), .(Y, Xs)) → S2L_IN(X, Xs)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
S2L_IN(x1, x2)  =  S2L_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

S2L_IN(s(X)) → S2L_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: